package com.vanvalt.payhui.modules.pay.service;

import org.apache.commons.lang3.StringEscapeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.CrudService;
import com.vanvalt.core.utils.SvrUtils;
import com.vanvalt.payhui.modules.pay.dao.PosDao;
import com.vanvalt.payhui.modules.pay.entity.Pos;

/**
 * @author Xiaoyang
 *
 */
@Service
@Transactional(readOnly = true)
public class PosService extends CrudService<PosDao, Pos> {

	@Autowired
	public PosDao posDao;
	
	@Transactional(readOnly = false)
	public void save(Pos pos) {
		if (pos.getDetails() != null){
			pos.setDetails(StringEscapeUtils.unescapeHtml4(pos.getDetails()));
		}
		SvrUtils.save(pos, posDao);
	}
}
